/**
 * 
 */
package com.hexacta.hrs.web.util;

import javax.servlet.jsp.PageContext;

import org.displaytag.decorator.DisplaytagColumnDecorator;
import org.displaytag.exception.DecoratorException;
import org.displaytag.properties.MediaTypeEnum;

/**
 * Decorator para la columna de Feedback Types
 * 
 * @author mtestasecca
 *
 */
public class FeedbackTypesDecorator implements DisplaytagColumnDecorator {
	
	private static final String FEEDBACK_TYPE_FORMAL = "F";
	private static final String FEEDBACK_TYPE_INFORMAL = "I";

	private static final String FORMAL_LABEL = "Formal";
	private static final String INFORMAL_LABEL = "Informal";

	public Object decorate(Object arg0, PageContext arg1, MediaTypeEnum arg2)
			throws DecoratorException {
		
		if (arg0 == null) { 
			return "";
		}
		
		if (arg0.equals(FEEDBACK_TYPE_FORMAL)) {
			return FORMAL_LABEL;
		} else {
			if (arg0.equals(FEEDBACK_TYPE_INFORMAL)) {
				return INFORMAL_LABEL;
			}
		}
		return "";
	}
}